<include file="Public/Header" />
<script src="__SCRIPT__/common.js" type="text/javascript"></script>
<script type="text/javascript">
    function clear_del()
    {
        if(confirm("确定要删除数据吗？"))
        {
            subform("{:U('Game/Category', 'do=deleteAll')}");
        }
    }
</script>
<table width="100%" height="31px" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
    <tr>
        <td height="31"><div class="titlebt">游戏列表</div></td>
    </tr>
</table>

<div class="main">
    <div class="operate">
        <div class="left">
            <input type="button" onclick="window.open('{:U('Game/Lists', 'do=addGame')}','main')" target="main" class="btn_blue" value="添加">
        </div>
        <div class="left_pad">
            <form method="get" action="{:U('Game/Lists', 'do=Search')}">
                <input type="text" name="keyword" title="关键字" class="inp_default" value="">
                <!-- 分类筛选 -->
                <include file="categorySelector"/>
                <input type="hidden" name="formhash" value="231cb4d8" />
                <input type="submit" class="btn_blue" value="查  询">
            </form>
        </div>
    </div>
    <div class="list">
        <form action="{:U('Game/GameList', 'do=sort')}" method="post" id="form_do" name="form_do">


            <table width="100%">
                <tr>
                    <th><input  name="chkall" type="checkbox" id="chkall" onClick="selectall(this.form)"></th>
                    <th>编号</th>
                    <th>标题</th>

                    <th>所属栏目</th>
                    <th>发布时间</th>
                    <th>修改时间</th>
                    <th>发布者</th>
                    <th>操作</th>
                </tr>

                <empty name="vlist">

                    <tr>
                        <td colspan="9">本区域暂无数据显示...</td>
                    </tr>
                    <else />
                    <volist name='vlist' id='v'>
                        <tr>
                            <td><input type="checkbox" name="id[]" value="{$v.game_id}"></td>
                            <td>{$v.game_id}</td>
                            <td class="aleft">
                                <a href="javascript:;" target="_blank">{$v.game_name}</a>
                            </td>
                            <td>{$v.class_name}</td>
                            <td>{$v.game_time_add|date='Y-m-d H:i:s', ###}</td>
                            <if condition="$v['game_time_update']">
                                <td>{$v.game_time_update|date='Y-m-d H:i:s', ###}</td>
                            <else />
                                <td></td>
                            </if>
                            <td>{$v.game_belongto_user_id}</td>
                            <td>
                                <a href="{:U('Game/Lists', 'do=edit&id='.$v['game_id'])}">编辑</a>
                                <a href="{:U('Game/Lists', 'do=delete&id='.$v['game_id'])}" class="delete-one">删除</a>
                            </td>
                        </tr>
                    </volist>
                </empty>

            </table>
        </form>

    </div>

    <div id="page-list" style="text-align: center"></div>

</div>
<include file="Public/Copyright" />
<script type="text/javascript" src="__PUBLIC__/Layerpage/laypage.js"></script>
<script type="text/javascript">
    laypage({
        cont: 'page-list',
        pages: {$pages},
        first: 1,
        last: {$pages},
        prev: '<',
        next: '>',
        curr: function(){
            var page = location.search.match(/page=(\d+)/);
            return page ? page[1] : 1;
        }(),
        jump: function(e, first){
            if(!first){
                location.href = page() + e.curr;
            }
        }
    });

    function page(){
        var u = location.href;
        var r = '';
        if(u.indexOf('&') > 0){
            r = location.href.replace(/&page=\d+/, '');
            return r + '&page=';
        }else if(u.indexOf('?') > 0 ){
            if(u.indexOf('?page') > 0 ){
                r = location.href.replace(/\?page=\d+/, '');
                return r + '?page=';
            }else{
                return r + '&page=';
            }
        }else{
            return location.href + '?page=';
        }
    }

    $('.delete-one').click(function(){
        if( ! window.confirm('确认要删除该游戏吗？') ){
            return false;
        }
    })
</script>
</body>
</html>
